package SQLx::Querylet::Plugin::Oracle;

use strict;
use warnings;

use base qw( SQL::Querylet::Plugin );

sub limit {
    my $self = shift;
    my ($n) = @_;
    return {
        sql => "ROWNUM <= $n",
        during => ['WHERE', 'AND'],
    };
}

sub index_hint {
    my $self = shift;
    my ($n) = @_;
    return {
        callback => sub {
            my ($query_string) = @_;
            my $v = $self->_query_verb(),
            $query_string =~ s{^($v)}{$1 /* +$n */}i;
            return $query_string;
        },
        callback_order => undef,
    };
}

1;

